<?php 
if (!defined('BASEPATH')) exit('No direct script access allowed');
 
class Seguridad extends CI_Controller {
 
    function __construct(){
        parent::__construct();
    }
 
    function chequear(){
        //echo "imprimiendo desde controlador base";
if(isset($this->session->userdata['privilegio'])){
			$privilegio = $this->session->userdata['privilegio'];
			}
			else{
			$privilegio = '-1';	
			}
		//echo $privilegio;
		
		 if($privilegio=='-1'){
		 $data['title'] = 'home';
		 $data['main_content'] = 'home';
		 $this->load->view('main_template',$data);
		 }
		 else {
		 return $privilegio;
    }
	}
	
	function protegerlogin() {
		if(isset($this->session->userdata['privilegio'])){
			$privilegio = $this->session->userdata['privilegio'];
			 if($privilegio!='-1'){
		 $data['title'] = 'home';
		 $data['main_content'] = 'home';
		 $this->load->view('main_template',$data);
		 }
		}
	}
}
